package job

import (
	"reflect"
	"testing"
)

func Test_resverNode(t *testing.T) {
	type args struct {
		root *ListNode
	}
	tests := []struct {
		name string
		args args
		want *ListNode
	}{
		{"1", args{nil}, nil},
		{"2", args{GetNode([]int{1})}, GetNode([]int{1})},
		{"3", args{GetNode([]int{1, 2})}, GetNode([]int{2, 1})},
		{"4", args{GetNode([]int{1, 2, 3})}, GetNode([]int{3, 2, 1})},
		{"5", args{GetNode([]int{1, 2, 3, 4})}, GetNode([]int{4, 3, 2, 1})},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if got := resverNode(tt.args.root); !reflect.DeepEqual(got, tt.want) {
				t.Errorf("%v resverNode() = %v, want %v", tt.name, got, tt.want)
			}
		})
	}
}
